<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    
    <title>欢迎来到注册页面 </title>
    
<%--<script type="text/javascript" charset="gb2312" src="verify.js">

</script>
  --%>
  <script type="text/javascript">
  function checkForm()
  {
	  var myreg = /^([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+@([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+\.[a-zA-Z]{2,3}$/;
//邮箱正则表达式
	  if(document.form1.userName.value.length==0)
		  {
		  	alert("请输入用户名！");
		  	document.form1.userName.focus();
		  	return false;
		  }
	  if(document.form1.pwd.value.length==0)
	  {
	  	alert("请输入密码!");
	  	document.form1.pwd.focus();
	  	return false;
	  }
	  if(document.form1.pwd.value!=document.form1.repwd.value)
		  {
		  	alert("两次输入的密码不一致！");
		  	document.form.pwd.focus();
		  	return false;
		  
		  }
	  if(!myreg.test(document.form1.verifyEmail.value))
		  {
		  	alert("请输入有效的邮箱");
		  	document.form1.verifyEmail.focus();
		  	return false;
		  
		  }
	  if(document.form1.verifycode.value.length==0)
		  {
		  	alert("请输入验证码！！");
		  	document.form1.verifycode.focus();
		  	return false;
		  
		  }
	  
	  return true;
	  
	  
  }
  function rename()
  {
  	var testname=document.getElementById("uname").value;
  	window.location.href="rename.jsp?name="+testname;
  }
  </script>
  </head>
  
  <body>
<form method="post" name="form1"  action="proReg.jsp" onsubmit="return checkForm()">
<table align="center">
<tr>
<td>账号：
</td>
<td><input type="text" name="cid" id="cid">
</td>
<td> <input type="button" value="是否重名" onclick="recid()">
<!-- <a href="recid.jsp?"+cid=document.form1.cid>账号是否重复 </a> -->
</td>
</tr>
<tr>
<td>用户名：
</td>
<td><input type="text" name="userName" id="uname">
</td>
<td> <input type="button" value="是否重名" onclick="rename()">
<!-- <a href="rename.jsp?"+name=document.form1.userName>是否重名 </a> -->
</td>
</tr>
<tr>
<td>密码：
</td>
<td><input type="password" name="pwd" id="upwd">
</td>
</tr>
<tr>
<td>确认密码：
</td>
<td><input type="password" name="repwd" id="reupwd">
</td>
</tr>
<tr>
<td>验证邮箱：
</td>
<td><input type="text" name="verifyEmail" >
</td>
</tr>
<tr>
<td>验证码：
</td>
<td><input type="text" name="verifycode">
</td>

<td><img  alt="点击换一张" title="点击换一张" src="img.jsp" onclick="this.src='img.jsp'" name="verify">
</td>
</tr>

<tr >
<td colspan=2>
<input type="submit" value="注册" >
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input type="reset"  value="重置"/>
</td>
</tr>
</table>


</form>

  </body>
</html>
